package com.example.server.service.impl;

import com.example.server.entity.Writer;
import com.example.server.mapper.WriterMapper;
import com.example.server.service.WriterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WriterServiceImpl implements WriterService {

    @Autowired
    private WriterMapper writerMapper;

    @Override
    public Writer getWriterById(int idwriter) {
        return writerMapper.getWriterById(idwriter);
    }

    @Override
    public List<Writer> getAllWriters() {
        return writerMapper.getAllWriters();
    }

    @Override
    public void insertWriter(Writer writer) {
        writerMapper.insertWriter(writer);
    }

    @Override
    public void updateWriter(Writer writer) {
        writerMapper.updateWriter(writer);
    }

    @Override
    public void deleteWriter(int idwriter) {
        writerMapper.deleteWriter(idwriter);
    }
}
